<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Finds the last occurrence of a needle within a haystack</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.iconv-strrpos" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">iconv_strrpos</h1>
  <p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">iconv_strrpos</span> &mdash; <span class="dc-title">Finds the last occurrence of a needle within a haystack</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.iconv-strrpos-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>iconv_strrpos</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$haystack</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$needle</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$charset</code><span class="initializer"> = ini_get(&quot;iconv.internal_encoding&quot;)</span></span>
  ] ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   Finds the last occurrence of a <code class="parameter">needle</code>
   within a <code class="parameter">haystack</code>.
  </p>
  <p class="para">
   In contrast to <span class="function"><a href="strrpos.html" class="function">strrpos()</a></span>, the return value of
   <span class="function"><strong>iconv_strrpos()</strong></span> is the number of characters that
   appear before the needle, rather than the offset in bytes to the
   position where the needle has been found. The characters are counted
   on the basis of the specified character set <code class="parameter">charset</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.iconv-strrpos-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">haystack</code></dt>

     <dd>

      <p class="para">
       The entire string.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">needle</code></dt>

     <dd>

      <p class="para">
       The searched substring.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">charset</code></dt>

     <dd>

      <p class="para">
       If <code class="parameter">charset</code> parameter is omitted,
       <code class="parameter">string</code> are assumed to be encoded in
       <a href="iconv.configuration.html" class="link">iconv.internal_encoding</a>.
      </p>
     </dd>

    
   </dl>

  </p>
  <p class="para">
   If <code class="parameter">haystack</code> or <code class="parameter">needle</code> is
   not a string, it is converted to a string and applied as the ordinal
   value of a character.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.iconv-strrpos-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the numeric position of the last occurrence of
   <code class="parameter">needle</code> in <code class="parameter">haystack</code>.
  </p>
  <p class="para">
   If <code class="parameter">needle</code> is not found,
   <span class="function"><strong>iconv_strrpos()</strong></span> will return <strong><code>FALSE</code></strong>.
  </p>
  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数可能返回布尔值
<strong><code>FALSE</code></strong>，但也可能返回等同于 <strong><code>FALSE</code></strong> 的非布尔值。请阅读 <a href="language.types.boolean.html" class="link">布尔类型</a>章节以获取更多信息。应使用
<a href="language.operators.comparison.html" class="link">===
运算符</a>来测试此函数的返回值。</p></div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.iconv-strrpos-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="strrpos.html" class="function" rel="rdfs-seeAlso">strrpos()</a> - 计算指定字符串在目标字符串中最后一次出现的位置</span></li>
    <li class="member"><span class="function"><a href="iconv_strpos.html" class="function" rel="rdfs-seeAlso">iconv_strpos()</a> - Finds position of first occurrence of a needle within a haystack</span></li>
    <li class="member"><span class="function"><a href="mb_strrpos.html" class="function" rel="rdfs-seeAlso">mb_strrpos()</a> - 查找字符串在一个字符串中最后出现的位置</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>